package com.tlx.util;

import javax.swing.JOptionPane;

public class SysUtils {

    public static void alertError(String error) {
        JOptionPane.showMessageDialog(null, error, "错误！", JOptionPane.ERROR_MESSAGE);
    }

    public static void alertError(Exception e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(null, e.getMessage(), "错误！", JOptionPane.ERROR_MESSAGE);
    }

    public static void exit(String msg) {
        alertError(msg + "\n" + "程序即将退出");
        System.exit(1);
    }

    public static void exit(String msg, Exception e) {
        alertError(msg + "\n" + e.getMessage() + "\n" + "程序即将退出");
        System.exit(1);
    }

}
